package com.gregbugaj.gps.cmd;

import java.util.HashMap;

import com.gregbugaj.gps.CommandType;

public class GPVTGCmd extends Command {

	public GPVTGCmd(CommandType type, String commandString) {
		super(type, commandString);
	}

	/**
	 *   $GPVTG,054.7,T,034.4,M,005.5,N,010.2,K*48

where:
        VTG          Track made good and ground speed
        054.7,T      True track made good (degrees)
        034.4,M      Magnetic track made good
        005.5,N      Ground speed, knots
        010.2,K      Ground speed, Kilometers per hour
	 *48          Checksum

	 */
	@Override
	public  HashMap<String, Object>  parse() {
		String[] parts=commandstring.split(",");
		HashMap<String, Object>  results=new HashMap<String, Object>();
		results.put("speed", Double.parseDouble(parts[6]));
		return results;
	}

}
